# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=wafp
pkgver=0.01_26c3
pkgrel=12
groups=('blackarch' 'blackarch-webapp' 'blackarch-fingerprint')
pkgdesc='An easy to use Web Application Finger Printing tool written in ruby using sqlite3 databases for storing the fingerprints.'
arch=('any')
url='http://packetstormsecurity.com/files/84468/Web-Application-Finger-Printer-0.01-26c3.html'
license=('unknown')
depends=('ruby' 'ruby-sqlite3')
source=("https://dl.packetstormsecurity.net/UNIX/scanners/$pkgname-${pkgver/_/-}.tar.gz")
sha512sums=('f900f7752379fe0efd27d21e0a03c343f553ca8ac5a28c5ffada0f15f5a2dd4a50de98dc68eb1aceae919ceda1085fec03a473c531a698b3dac6fa45584887ef')

package() {
  cd "$pkgname-${pkgver/_/-}"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" CREDITS HOWTO README
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm CREDITS HOWTO README LICENSE

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ruby $pkgname.rb "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

